<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/pages/common/common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>index</title>
<!-- 首页布局样式文件 -->
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/index.css">
<!-- end -->
<script src="<%=path%>/js/jquery/jquery.js" type="text/javascript"></script>
<script src="<%=path%>/js/appjs/tree.js" type="text/javascript"></script>
</head>
<body>
	<div id="test1">dd
	</div>
	<script type="text/javascript">
		window.onload = function(){
			parse1();
			
			$("#test1").text(html.join(""));
			
		};
		var treedata = [{ "id": "1", "text": "浙江政府机构", "value": "source", "showcheck": false, "complete": true, "isexpand": true, "checkstate": 0, "hasChildren": true, "ChildNodes": [{ "id": "2", "text": "浙江省委", "value": "source", "path":"main.jsp","showcheck": false, "complete": false, "isexpand": false, "checkstate": 0, "hasChildren": false, "ChildNodes": null },{ "id": "3", "text": "杭州市委", "value": "source", "path":"http://www.baidu.com", "showcheck": false, "complete": true, "isexpand": false, "checkstate": 0, "hasChildren": false, "ChildNodes": null },{ "id": "4", "text": "浙江省政府", "value": "source", "showcheck": false, "complete": false, "isexpand": false, "checkstate": 0, "hasChildren": false, "ChildNodes": null },{ "id": "5", "text": "杭州政府", "value": "source", "showcheck": false, "complete": false, "isexpand": false, "checkstate": 0, "hasChildren": false, "ChildNodes": null }] },{ "id": "6", "text": "公共事业机构", "value": "source", "showcheck": false, "complete": false, "isexpand": true, "checkstate": 0, "hasChildren": true, "ChildNodes": [{ "id": "7", "text": "医疗机构", "value": "source", "showcheck": false, "complete": false, "isexpand": false, "checkstate": 0, "hasChildren": false, "ChildNodes": null },{ "id": "8", "text": "水利", "value": "source", "showcheck": false, "complete": false, "isexpand": false, "checkstate": 0, "hasChildren": true, "ChildNodes": [{"id":90, "text":"测试", "hasChildren": false, "ChildNodes":null}] }] }];
		
		var html = [];
		
		function parse1(){
			for(i=0; i< treedata.length; i++){
				build1(treedata[i]);
			}
		}
		
		function build1(node){
			html.push("<div title=\""+node.text+"\">");
			
			if(node.hasChildren){
				for(j=0; j< node.ChildNodes.length; j++){
					if((node.ChildNodes[j]).hasChildren){
						build1(node.ChildNodes[j]);
					}else{
						html.push("<a href=\"javascript:void(0);\" class=\"cs-navi-tab\" src=\"http://www.baidu.com\">" + (node.ChildNodes[j]).text + "</a></p>");
					}
				}
			}
			
			html.push("</div>");
		}
		
		
	</script>
</body>
</html>